import request from '@/utils/request'

// 查询车位列表
export function listSpot(query) {
  return request({
    url: '/system/spot/list',
    method: 'get',
    params: query
  })
}
// 查询车位楼层信息
export function listFloor(query) {
  delete query['pageNum'];
  delete query['pageSize'];
  return request({
    url: '/system/floor/all',
    method: 'get',
    params: query
  })
}

// 查询车位详细
export function getSpot(id) {
  return request({
    url: '/system/spot/' + id,
    method: 'get'
  })
}

// 新增车位
export function addSpot(data) {
  return request({
    url: '/system/spot',
    method: 'post',
    data: data
  })
}

// 修改车位
export function updateSpot(data) {
  return request({
    url: '/system/spot',
    method: 'put',
    data: data
  })
}

// 删除车位
export function delSpot(id) {
  return request({
    url: '/system/spot/' + id,
    method: 'delete'
  })
}
// 批量车位可用
export function handleUsable(id) {
  return request({
    url: '/system/spot/handleUsable/'+id,
    method: 'put'
  })
}
// 批量车位可用
export function handleDisabled(id) {
  return request({
    url: '/system/spot/handleDisabled/'+id,
    method: 'put'
  })
}
